package com.unirio.pm.rules;

import com.unirio.pm.interfaces.PasswordRule;

public class RegexChecker implements PasswordRule {
	
	private String description;
	private String regex;
	private int score;
	
	public RegexChecker(String regex, int score){
		this.description = "";
		this.regex = regex;
		this.score = score;
	}
	
	public RegexChecker(String description, String regex, int score) {
		this.description = description;
		this.regex = regex;
		this.score = score;
	}

	public int checkRule(String password) {
		int score = 0;
    	if(password.matches(this.regex)) {
    		score = this.score;
    	}
    	return score;
	}
	

}
